package com.ruoyi.partybuilding.domain;

import java.util.Date;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Table;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.ruoyi.partybuilding.common.EQuery.CreateByEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.*;
/**
 * 消息对象 pb_message
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */
@Table("pb_message")
@Data
public class Message extends CreateByEntity.LongId
{
    private static final long serialVersionUID = 1L;

    public Message(){}
    public Message(String title,String content,Long userId,String userName,String sourceName,String sourceId,String createBy){

        this.title = title;
        this.content = content;
        this.userId = userId;
        this.sourceName = sourceName;
        this.sourceId = sourceId;
        setUserName(userName);
        setStatus(0l);
        setCreateTime(new Date());
        setType(0l);
        setCreateBy(createBy);

    }

    /**  ; */
    @ApiModelProperty(value = "")
    @Excel(name = "", readConverterExp = "")
    private String title;

    /** 0普通提醒消息 ; */
    @ApiModelProperty(value = "0普通提醒消息")
    @Excel(name = "0普通提醒消息")
    private Long type;

    /** 内容 ; */
    @ApiModelProperty(value = "内容")
    @Excel(name = "内容")
    private String content;

    /** 详情跳转地址 ; */
    @ApiModelProperty(value = "详情跳转地址")
    @Excel(name = "详情跳转地址")
    private String url;

    /** 状态，0未读，1已读 ; */
    @ApiModelProperty(value = "状态，0未读，1已读")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @Excel(name = "状态，0未读，1已读")
    private Long status;


    /** 失效时间 ; */
    @ApiModelProperty(value = "失效时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "失效时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 接收人id ; */
    @ApiModelProperty(value = "接收人id")
    @Excel(name = "接收人id")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    private Long userId;

    /** 接收人名称 ; */
    @ApiModelProperty(value = "接收人名称")
    @Excel(name = "接收人名称")
    private String userName;

    /** 创建者名称，可能是sys ; */
    @ApiModelProperty(value = "创建者名称，可能是sys")
    @Excel(name = "创建者名称，可能是sys")
    private String sourceName;

    /** 关联来源id ; */
    @ApiModelProperty(value = "关联来源id")
    @Excel(name = "关联来源id")
    private String sourceId;

    String remark;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.RANGE_LEFT_OPEN)
    private Date createTime;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("title", getTitle())
            .append("type", getType())
            .append("content", getContent())
            .append("url", getUrl())
            .append("status", getStatus())
            .append("endTime", getEndTime())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("sourceName", getSourceName())
            .append("sourceId", getSourceId())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .toString();
    }
}
